home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1996 / MacHack 1996.toast / Hacks / Hacks ’92 / Apple Menu Munging / WeirdAppleMenuIcons ReadMe &src < prev   
Text File  |  1992-06-19  |  3KB  |  82 lines

  1. /*
  2.     Scare your friends. Make new enemies. 
  3.     
  4.     AppleMenuDistortion lets you distort the size of the icons in the Apple Menu to
  5.     just about any size you want. Tall and thin, wide and narrow, the size of the
  6.     screen, etc.
  7.     
  8.     The effect can be installed into a single application. When that app is run, it's 
  9.     Apple Menu icons will be weird. You control just how weird, which effects just how
  10.     upset unsuspecting friend/coworkers may become.
  11.     
  12.     To effect all applications, install into the System file.
  13.     
  14.     To relieve any ensuing angst among the victims, just use the Remove button.
  15.     
  16.     
  17.     This isn't really a hack, it's to absurdly easy to create But it -looks- like something
  18.     very sick is happening, so that counts for something. It depends on
  19.     a the System 7 menubar defproc, which for some reason tries to locate a 
  20.     color icon with ID 256. If it finds such an icon, it uses the icon's bounds 
  21.     rect to scale the Apple Menu icons. 
  22.     
  23.     The purpose for this, and whether it is intentional or just a side effect, is 
  24.     unknown to me. When I stumped the panel of experts with this question (hey,
  25.     where's my Stump shirt?) someone on the panel suggested that the icon was
  26.     meant "to anti-alias the Apple icon". Since the panel is well known for jiving
  27.     when at a total loss, I doubt this. Besides, do you see any anti-aliasing?
  28.     
  29.     
  30.     I wrote this at MacHack '92, at about 4:30 AM, sitting in the audience after the hack.
  31.     demonstration was well under way. Distribute freely....
  32.     
  33.     ©1992 Bill Monk/MonkWorks
  34.  
  35.     Bill Monk
  36.     CIS: 72511,301
  37.     AppleLink MONK
  38.     internet: 72511.301@compuserve.com
  39.     
  40.     */ 
  41.     
  42. /* This just demonstrates the technique. Plug it into your own dialog. 
  43.    Provide your own 'cicn' ID 256, too. I'm too tired after staying up all night. 
  44.  */
  45. munge_icon( void )    
  46. {
  47. short    eCode = noErr,
  48.         saveResFile,
  49.         right,
  50.         bottom;    
  51. Str255  string;
  52. long    width, 
  53.         height;
  54.  
  55.  
  56. /*  get size factors out of the dialog - use your own routines here, this is
  57.     just an example.
  58.  
  59.     get_dialog_text( theDialog, rightItem, string );
  60.     StringToNum( string, &right );
  61.     
  62.     get_dialog_text( theDialog, bottomItem, string );
  63.     StringToNum( string, &bottom );
  64. */
  65.  
  66.     iconH  = (CIconHandle)GetResource( 'cicn', 256 );
  67.     if( !ResError() && iconH != nil )
  68.         {
  69.                              
  70.         right  = (**iconH).iconPMap.bounds.left + width;
  71.         bottom = (**iconH).iconPMap.bounds.top + height;
  72.         
  73.         (**iconH).iconPMap.bounds.right  = right;
  74.         (**iconH).iconPMap.bounds.bottom = bottom;
  75.  
  76.       // Now: look at the Apple Menu. The icons look more interesting now.
  77.       // Save the munged resource if you wish...
  78.  
  79.         }
  80.  
  81.  
  82. } /* end */